package com.bonc.datasource.multiple;

import com.bonc.datasource.config.DynamicContextHolder;
import lombok.extern.slf4j.Slf4j;
import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;

@Slf4j
public class MultipleDataSource extends AbstractRoutingDataSource {
    public static MultipleDataSource build() {
        return new MultipleDataSource();
    }

    @Override
    protected Object determineCurrentLookupKey() {
        return DynamicContextHolder.peek();
    }
}
